package com.safe.text;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class OnStartReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
			final SharedPreferences prefs = PreferenceManager
					.getDefaultSharedPreferences(context);
			if (prefs.getBoolean("startOnBootup", false)) {
				//if (prefs.getBoolean("serviceStatus", false)) {
					Intent mainService = new Intent(
							"com.safe.text.MainService");
					context.startService(mainService);
				//}
			}
		}
	}
}